package cmd

import (
	"fmt"
	"os/exec"
)

func ExecScript(scriptPath string) error {
	cmd := exec.Command("/bin/bash", "-c", scriptPath)

	output, err := cmd.Output()
	if err != nil {
		fmt.Printf("Execute Shell:%s failed with error:%s", scriptPath, err.Error())
		return err
	}
	fmt.Printf("Execute Shell:%s finished with output:\n%s", scriptPath, string(output))
	return nil
}
